################### constant need change before build ###############################3
set(DEBUGGER ON)
set(PYTHON_VERSION 3.9)
set(PYBIND11_PYTHON_VERSION ${PYTHON_VERSION})
set(PYTHON_ENV_LOCATION /home/oem/Development/Envs/anaconda3/envs/arcus)

set(PYTHON_DEFAULT_EXECUTABLE ${PYTHON_ENV_LOCATION}/bin/python)
set(PYTHON_EXECUTABLE ${PYTHON_ENV_LOCATION}/bin/python)
set(PYTHON3_INCLUDE_DIR ${PYTHON_ENV_LOCATION}/include/python${PYTHON_VERSION}m)
set(PYTHON3_LIBRARY ${PYTHON_ENV_LOCATION}/lib/libpython${PYTHON_VERSION}.so)


###################### 3rdparty location #######################
set(PYTHON3_PACKAGES_PATH ${PYTHON_ENV_LOCATION}/lib/python${PYTHON_VERSION}/site-packages)
set(NUMPY_INCLUDE ${PYTHON3_PACKAGES_PATH}/numpy/core/include)

set(OpenCV_DIR /home/oem/Development/Envs/opencv_460/lib/cmake/opencv4)
set(pybind11_DIR ${PYTHON3_PACKAGES_PATH}/pybind11/share/cmake/pybind11)

find_package(OpenCV REQUIRED)
find_package(pybind11 REQUIRED)
#find_package(OpenMP)  # 和CUDA模块冲突，编译无法通过，需要每个用到的模块自己添加
find_package(CUDA REQUIRED)
#enable_language(CUDA)

####################  add build ##################################
CUDA_ADD_CUDA_INCLUDE_ONCE()  # 这句话来自FindCUDA.cmake
include_directories(
        ${OpenCV_INCLUDE_DIRS}
        ${PYBIND11_INCLUDE_PATH}
        ${PYTHON3_INCLUDE_DIR}
        ${NUMPY_INCLUDE}
)  # headers
link_libraries(
        ${OpenCV_LIBS}
        ${PYTHON3_LIBRARY}
        pybind11::embed
#        OpenMP::OpenMP_CXX
)  # libs

# global include
include(GNUInstallDirs)  # 标准的模块安装常量
include(CMakePackageConfigHelpers)  # 用于生成Config文件
include(CMakeFindDependencyMacro)  # 依赖关系检查

